#include "Request.h"

Request::Request(int id, vector<float> distances, float release_time)
{
	this->id = id;
	this->distances = distances;
	this->release_time = release_time;
	this->visited_time = 0.0;
}

Request::~Request()
{
}

bool Request::operator<(Request &req) {
	if (release_time != req.release_time)
		return release_time < req.release_time;
	else
		return this->get_distance_from_origin() < req.get_distance_from_origin();
}

bool Request::operator==(const Request &req) {
	return id == req.id;
}

float Request::get_distance(Request &req) {
	return distances[req.id];
}

Request::Request(const Request &request) {
	release_time = request.release_time;
	id = request.id;
}

float Request::get_distance_from_origin() {
	return distances[0];
}

Request& Request::operator=(const Request &request) {
	release_time = request.release_time;
	visited_time = request.visited_time;
	id = request.id;
	distances = request.distances;
	return *this;
}

